package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the VERIFICA_TITU_PEND database table.
 * 
 */
@Embeddable
public class VerificaTituPendPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String regPubId;
	private String oficRegId;
	private String numPartida;
	private String anoTitu;
	private String numTitu;
	private String areaRegId;
	private long objetoSolId;
	private String sistemaId;

    public VerificaTituPendPK() {
    }

	@Column(name="REG_PUB_ID", unique=true, nullable=false, length=2)
	public String getRegPubId() {
		return this.regPubId;
	}
	public void setRegPubId(String regPubId) {
		this.regPubId = regPubId;
	}

	@Column(name="OFIC_REG_ID", unique=true, nullable=false, length=2)
	public String getOficRegId() {
		return this.oficRegId;
	}
	public void setOficRegId(String oficRegId) {
		this.oficRegId = oficRegId;
	}

	@Column(name="NUM_PARTIDA", unique=true, nullable=false, length=8)
	public String getNumPartida() {
		return this.numPartida;
	}
	public void setNumPartida(String numPartida) {
		this.numPartida = numPartida;
	}

	@Column(name="ANO_TITU", unique=true, nullable=false, length=4)
	public String getAnoTitu() {
		return this.anoTitu;
	}
	public void setAnoTitu(String anoTitu) {
		this.anoTitu = anoTitu;
	}

	@Column(name="NUM_TITU", unique=true, nullable=false, length=8)
	public String getNumTitu() {
		return this.numTitu;
	}
	public void setNumTitu(String numTitu) {
		this.numTitu = numTitu;
	}

	@Column(name="AREA_REG_ID", unique=true, nullable=false, length=5)
	public String getAreaRegId() {
		return this.areaRegId;
	}
	public void setAreaRegId(String areaRegId) {
		this.areaRegId = areaRegId;
	}

	@Column(name="OBJETO_SOL_ID", unique=true, nullable=false)
	public long getObjetoSolId() {
		return this.objetoSolId;
	}
	public void setObjetoSolId(long objetoSolId) {
		this.objetoSolId = objetoSolId;
	}

	@Column(name="SISTEMA_ID", unique=true, nullable=false, length=3)
	public String getSistemaId() {
		return this.sistemaId;
	}
	public void setSistemaId(String sistemaId) {
		this.sistemaId = sistemaId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof VerificaTituPendPK)) {
			return false;
		}
		VerificaTituPendPK castOther = (VerificaTituPendPK)other;
		return 
			this.regPubId.equals(castOther.regPubId)
			&& this.oficRegId.equals(castOther.oficRegId)
			&& this.numPartida.equals(castOther.numPartida)
			&& this.anoTitu.equals(castOther.anoTitu)
			&& this.numTitu.equals(castOther.numTitu)
			&& this.areaRegId.equals(castOther.areaRegId)
			&& (this.objetoSolId == castOther.objetoSolId)
			&& this.sistemaId.equals(castOther.sistemaId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.regPubId.hashCode();
		hash = hash * prime + this.oficRegId.hashCode();
		hash = hash * prime + this.numPartida.hashCode();
		hash = hash * prime + this.anoTitu.hashCode();
		hash = hash * prime + this.numTitu.hashCode();
		hash = hash * prime + this.areaRegId.hashCode();
		hash = hash * prime + ((int) (this.objetoSolId ^ (this.objetoSolId >>> 32)));
		hash = hash * prime + this.sistemaId.hashCode();
		
		return hash;
    }
}